package com.mask.sca.system.controller;

import com.mask.sca.auth.api.feign.FeignAuthService;
import com.mask.sca.core.response.ApiResponse;
import com.mask.sca.core.vo.LoginParamVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @className：LoginController
 * @Description: 后台登录模块
 * @Author：jian
 * @Date：2025/8/1 01:54
 */
@RestController
@RequestMapping("system")
public class LoginController {

    @Resource
    private FeignAuthService authService;

    @RequestMapping("login")
    public ApiResponse<Map<String, Object>> login(@RequestBody LoginParamVo loginParamVo){
        Map<String, Object> params = new HashMap<>();
        params.put("username", loginParamVo.getUsername());
        params.put("password", loginParamVo.getPassword());
        params.put("login_type","admin");
        params.put("client_id", "client");
        params.put("client_secret", "secret");
        return authService.passwordLogin(params);
    }
}
